package com.monkeybrother.thread.callable;

import java.util.concurrent.*;
import java.util.stream.IntStream;
import java.util.stream.LongStream;

/**
 * @Desc
 * @Author houry
 * @Date 2021/4/4 14:05
 **/
public class MyCallable implements Callable<String> {
    private int sleepTime;
    private String msg;

    public MyCallable(int sleepTime, String msg) {
        this.sleepTime = sleepTime;
        this.msg = msg;
    }

    @Override
    public String call() throws Exception {
        TimeUnit.SECONDS.sleep(sleepTime);
        System.out.println("线程休眠了：" + sleepTime + "秒执行完毕");
        return msg;
    }
}
